package com.homni.testbutterknife;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {


    @BindView(R.id.tv_main)
    TextView tvMain;
    @BindView(R.id.btn_test)
    Button btnTest;
    @BindView(R.id.tv_seekbar_value)
    TextView seekbarValue;
    @BindView(R.id.seekbar_test)
    SeekBar seekbarTest;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ButterKnife.bind(this);
 
        initListener();

    }

    @OnClick(R.id.btn_test)
    public void btnOnClick(){
        tvMain.setText("我是大神");
    }

    private void initListener(){
        seekbarTest.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
                seekbarValue.setText("进度值是：" + i);
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });
    }
}
